package day4;

import day2.People;
import day3.Nvren;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/**
 * @author oldliu
 * @since 1.0
 */
public class MapFanxing {
    public static void main(String[] args) {
        Map<People,String> map=new HashMap<>();
        map.put(new People("小吴","女",22),"最帅");
        map.put(new People("laozhang","男",42),"最矮");
        map.put(new Nvren("小翠",21),"最年轻");

        System.out.println("----map内部迭代------");
        //Set<People> people = map.keySet();
        Set<Map.Entry<People, String>> entries = map.entrySet();
        for (Map.Entry<People, String> e:entries){
            People p = e.getKey();
            String str = e.getValue();
            System.out.println(p+"==="+str);
        }
    }
}
